<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'result.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="assets/ico/bioroad-logo.ico" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-popover.js"></script>
<script type="text/javascript" src="js/bootstrap-scrollspy.js"></script>

<style type="text/css">
body {
	background-image: url("");
	font-family: 方正静蕾简体;
}

#sampleInfoPage {
	
	position: absolute;
	top:0px;
	width: 700px;
	margin-top: 320px;
	margin-left: 360px;
}

form {
	font-size: 16px;
	
}

#titlediv {
	margin-bottom: 0px;
}

.content {
	padding-left: 18px;
	background-color: #E8F5F7;
}

.add-on {
	font-size: 14px;
}

.form-actions {
	margin-right: 52%;
}

.scrollspy-example {
	height: 200px;
	overflow: auto;
	position: relative;
}
</style>
</head>
<body>
	<%@ include file="main.jsp"%>
	<div id="sampleInfoPage">

		<c:if test="${empty sampleInfosList}">
				o(╯□╰)o您要搜索的暂时没有数据>>>>>>>>>>>
			</c:if>
		<c:forEach var="sampleInfo" items="${sampleInfosList}">
			<i class="icon-list"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="gotoSampleInfoOrderPage.action?sampleInfoSn=${sampleInfo.sn}">${sampleInfo.code}</a>
			<br />
		</c:forEach>
		<!-- ----------------------------------------------------------------------------------------------------- -->
		<hr />
		<c:if test="${not empty sampleInfosList}">
			<span style="color: #999">找到相关的结果${totalcount}条,${maxPage}页,搜索共耗时：${time}秒</span>
			<div class="pagination">
				<ul>
					<li><a id="firstpage" rel="0" href="javascript:void(0)">首页</a>
					</li>

					<li><a id="before" href="javascript:void(0)">上一页</a></li>

					<c:forEach var="pagenum" items="${pagenum}">
						<li><a class="pagenum" rel="${pagenum}"
							href="javascript:void(0)">${pagenum}</a>
						</li>
					</c:forEach>

					<li><a id="next" href="javascript:void(0)">下一页</a></li>

					<li><a id="lastpage" rel="${maxPage-1}"
						href="javascript:void(0)">尾页</a></li>
				</ul>
			</div>
			<%--分页的隐藏域 --%>
			<input id="nowpage" type="hidden" style="display:none"
				value="${nowPage} " />
			<input id="hiddensearchnameForSample" type="hidden"
				style="display:none" value="${searchSampleInfoName}" />
		</c:if>
	</div>


</body>
<script type="text/javascript" charset="gbk">
	$(function(){
		$("#quickSearch").click(function(){
			$("#sampleInfoPage").css("display","none");
		});
		$("#advancedSearch").click(function(){
			$("#sampleInfoPage").css("display","none");
		});
		$("#searchSampleInfo").click(function(){
			$("#sampleInfoPage").css("display","block");
		});
		
		
	});

	$(function() {
		$("#before").click(
				function() {
					var nowP = parseInt($("#nowpage").val());
					if (nowP == 0) {
						return false;
					}
					nowP = nowP - 1;
					if (nowP < 0) {
						nowP = 0;
					}
					window.location.href = "searchSampleInfo.action?nowPage="
							+ nowP + "&searchSampleInfoName="
							+ $("#hiddensearchnameForSample").val();
				});
		$("#next").click(
				function() {
					var nextP = parseInt($("#nowpage").val());
					if (nextP == $("#lastpage").attr("rel")) {
						return false;
					}
					var m = parseInt($("#lastpage").attr("rel"));
					nextP = nextP + 1;
					if (nextP > m) {
						nextP = m;
					}
					window.location.href = "searchSampleInfo.action?nowPage="
							+ nextP + "&searchSampleInfoName="
							+ $("#hiddensearchnameForSample").val();
				});

		$(".pagenum").click(
				function() {
					//alert($(this).attr("rel"));
					//alert($("#hiddensearchnameForSample").val());
					var page = $(this).attr("rel");
					if (parseInt(page) == (parseInt($("#nowpage").val()) + 1)) {
						return false;
					}
					window.location.href = "searchSampleInfo.action?nowPage="
							+ (parseInt(page) - 1) + "&searchSampleInfoName="
							+ $("#hiddensearchnameForSample").val();
				});

		$("#firstpage").click(
				function() {
					if (parseInt($("#nowpage").val()) == ($("#firstpage")
							.attr("rel"))) {
						return false;
					}
					window.location.href = "searchSampleInfo.action?nowPage="
							+ $("#firstpage").attr("rel")
							+ "&searchSampleInfoName="
							+ $("#hiddensearchnameForSample").val();
					$("#firstpage").parent().addClass("active");
				});
		$("#lastpage").click(
				function() {
					if (parseInt($("#nowpage").val()) == ($("#lastpage")
							.attr("rel"))) {
						return false;
					}
					$("#hiddensearchnameForSample").val();
					window.location.href = "searchSampleInfo.action?nowPage="
							+ $("#lastpage").attr("rel")
							+ "&searchSampleInfoName="
							+ $("#hiddensearchnameForSample").val();
				});
		$("#quickSearch").parent().removeClass();
		$("#searchSampleInfo").parent().addClass("active");
		$("#profileQuick").removeClass("active in");
		$("#profileOrder").addClass("active in");
	});
</script>
</html>
